package yhao.demo.service.login.api;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yhao.demo.service.login.apilist.model.LoginPersonModel;
import yhao.demo.service.login.service.LoginService;
import yhao.infra.apilist.RequestResult;
import yhao.infra.apilist.RestfulBaseController;
import yhao.infra.apilist.validate.LoginForm;

import javax.annotation.Resource;

/**
 * Created by yoara on 2019/1/16.
 */
@RestController
@RequestMapping(value = "/login")
public class LoginApi extends RestfulBaseController {
    @Resource
    private LoginService loginService;

    @PostMapping("/authenticatePerson")
    public RequestResult<LoginPersonModel> authenticatePerson(@RequestBody LoginForm form){
        return new RequestResult(loginService.authenticatePerson(form));
    }
}
